<%--
 *  File:    org.jsp
 *  @Author: KentZhong
 *  Date:    2002/07/30
 *	@Modifier: Jamesli
 *  Date:    2010/06/28
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.org");  
  String strPrivCode=(String)request.getParameter("third");  
  if( strPrivCode==null)
    strPrivCode=(String)session.getAttribute("third");
  if(strPrivCode==null)
    strPrivCode="";
  String privilegeCode = strPrivCode;
  String strModuleName = "UPM";
  String contentRoot = request.getContextPath();
%>
  

 <%
    HashMap CurUserInfo=(HashMap)session.getAttribute("userinfo");
    if(CurUserInfo==null)
        CurUserInfo=new HashMap();
    cat.debug("CurUserInfo is:"+CurUserInfo);
 %> 

<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%
	String strOrgid=request.getParameter("orgid");
    String strNewchild=request.getParameter("newchild");
    String strGlobalpccode=request.getParameter("globalpccode");
    String strLanguagecode=request.getParameter("languagecode"); 
    String displayflag="";
    String strParentorgid=request.getParameter("parentorgid"); 
    String strGrade=request.getParameter("grade"); 
    String strInfo=request.getParameter("info");
    String strParam="";
     if(request.getParameter("info")!=null)
	{
	  displayflag="view";
	}
    if( strLanguagecode==null)
        strLanguagecode="cn";
    strParam+="&languagecode="+strLanguagecode;
    if(strOrgid!=null)
        strParam+="&orgid="+strOrgid;
   if(strNewchild!=null)
        strParam+="&newchild="+strNewchild;
    
    cat.debug("strOrgid!=null is:"+(strOrgid!=null)); 
    cat.debug("strParam!=null is:"+strParam);
%>
<html>
<head>
<title>org</title>
<%if(strOrgid!=null){%>
<PageFlow:CheckPageFlow pageName="org"/>
<%}%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="javascript">
	function page_none()
{
    alert('<%=message.getMessageDesc("SAVE_INFO_FIRST")%>');
    return;
}
function page_back()
{
  if(parent.opener != null)
    window.close();
  else
    parent.location.href = "OrgSummary.jsp?<%= OvalTools.randomURL() %>&orgid=<%=JspHelper.filterNull(strOrgid)%>&languagecode=<%=strLanguageCode%>";
}
function clicked(obj){
var type=obj.id;
<%if(strOrgid!=null){%>
    if (type == "A01"){
            <%if(strInfo!=null && strInfo.equalsIgnoreCase("Y")){%>
                parent.down1.location.href="<%=JspHelper.filterNull(contentRoot)%>/masterdata/ogm/OrgInfo.jsp?<%= OvalTools.randomURL() %>&orgid=<%=JspHelper.filterNull(strOrgid)%>&languagecode=<%=strLanguageCode%>";
          <%}else{%>
                parent.down1.location.href="<%=JspHelper.filterNull(contentRoot)%>/masterdata/ogm/OrgEdit.jsp?<%= OvalTools.randomURL() %><%=JspHelper.filterNull(strParam )%>&fromURL=MyOrgFrm";
          <%}%>
    }
<%}else{%>
     page_none();
<%}%>
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <form name="cform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="org">
      <input type="hidden" name="actionname">
      <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
      
      
 <%
 strLanguagecode=strLanguageCode;
 if(strOrgid!=null)
 {
    String strOrgNewChild=(String)pageContext.getAttribute("newchild");
    String strOrgShowInfo=(String)pageContext.getAttribute("info");
    HashMap orginfo=(HashMap)pageContext.getAttribute("orginfo");
    cat.debug("newchild is :"+strOrgNewChild);
    cat.debug("info is :"+strOrgShowInfo);
    cat.debug("orginfo is :"+orginfo);
    
    
    if(strGlobalpccode!=null)
        strParam+="&globalpccode="+strGlobalpccode;
    else if(orginfo.get("globalpccode")!=null)
        strParam+="&globalpccode="+orginfo.get("globalpccode");
    
    if(strParentorgid!=null)
        strParam+="&parentorgid="+strParentorgid;
    else if(orginfo.get("parentorgid")!=null)
        strParam+="&parentorgid="+orginfo.get("parentorgid");
    
    if(strGrade!=null)
        strParam+="&grade="+strGrade;
    else if(orginfo.get("grade")!=null)
        strParam+="&grade="+orginfo.get("grade");
    
 %> 
      <input type="hidden" name="info" value="<%=JspHelper.filterNull((strInfo==null)?"":strInfo)%>">
      <input type="hidden" name="orgid" value="<%=JspHelper.filterNull((strOrgid==null)?"":strOrgid)%>">
      <input type="hidden" name="newchild" value="<%=JspHelper.filterNull((strNewchild==null)?"":strNewchild)%>">
    
      <input type="hidden" name="globalpccode" value='<oval:write name="orginfo" property="globalpccode"/>'>
      <input type="hidden" name="parentorgid" value='<oval:write name="orginfo" property="parentorgid"/>'>
      <input type="hidden" name="grade" value='<oval:write name="orginfo" property="grade"/>'>
      
 <%}%>         
<table width="100%" cellspacing="0" cellpadding="0">
  <tr> 
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">

  <tr> 
    <td valign="top"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="3">
        <tr> 
          <td class="summary_top"></td>
        </tr>
        <tr> 
        <%if(strOrgid!=null){%>
        <td>
                <%
                    Vector vec = new Vector();
                    HashMap tabHash = new HashMap();
                    tabHash.put("id","A01");
                    tabHash.put("label","L_Summary");
//                  tabHash.put("onclick","clicked('Summary');");
                    vec.add(new HashMap(tabHash));

                %>      
                <custom:tab  vecAttr="<%=vec%>" defaultID="A01" />
            </td>       
                        
         <%}%>          
        </tr>           
                        
      </table>          
    </td>               
  </tr>                                   
</table>                
</form>                 
</body>                 
</html>                 
                        
                        
                        
                        
                        
                        
